'''----案例：QQ群类----
编写一个QQ群类：
属性：群号、群名、成员、群暗号
方法：显示群号、显示群名、显示群成员、出示群暗号、添加群成员、移除群成员'''

class QQ_group:
    fhd="aaa"
    def __init__(self,numbers,group_name,members_list,signal):
        self.numbers=numbers
        self.group_name=group_name
        self.members_list=members_list
        self.signal=signal
    def display_numbers(self):
        print(self.numbers)
    def display_group_name(self):
        print(self.group_name)
    def display_members_list(self):
        print(self.members_list)
    def display_signal(self):
        tag=0
        pwd=int(input("请输入群暗号："))
        if pwd ==self.signal:
            tag=1
        return tag
    def add_member(self):
        tag=display_signal()
        if tag==1:
          newmember=input("请输入新成员名字：")
          self.members_list.append(newmember)
        else:
            print("群暗号对不上")
    def del_member(self):
        tag = display_signal()
        if tag == 1:
            del_member = input("请输入要删除成员名字：")
            for member in self.members_list:
                if del_member==member:
                    self.members_list.remove(member)
                    print(self.members_list)
        else:
            print("群暗号对不上")
if __name__ == '__main__':
    group1=QQ_group(273922,"王者归来",["张三","李四"],123456)
    group1.display_group_name()